<template>
  <div>
    <custom-table
      :columns="columns"
      :query="queryParams"
      :row-btn="rowBtn"
      v-bind="$attrs"
      v-on="listeners"
      @tap-head-btn="onTapHeadBtn"
      @tap-row-btn="onTapRowBtn"
      @row-dblclick="onRowDbClick"
    >
    </custom-table>
  </div>

</template>

<script>
import tableMixin from '@/utils/mixin/custom-table'
// import mock from '@/utils/mixin/mock'

// var Mock = require('mockjs')
// import { randomNum } from '@/utils'

export default {
  data() {
    return {
      columns: [
        { name: '名称', field: 'name' },
        { name: '面积', field: 'area', after: 'm²', type: 'tag' },
        { name: '租金', field: 'amount', after: '元', type: 'tag' },
        { name: '物业费', field: 'property_price', after: '元', type: 'tag' },
        { name: '可住人数', field: 'live_number', after: '人', type: 'tag' },
        // { name: '状态', field: 'status', label: true, type: this.checkAuth('change') ? 'switch' : 'tag', opts: {} },
        // { name: '状态', field: 'status', type: 'tag', opts: {} },
        { name: '添加时间', field: 'create_time' }
      ]
    }
  },
  components: {},
  mixins: [
    tableMixin
    // mock
  ],
  computed: {
    rowBtn() {
      return [
        // {
        //   name: '绑定',
        //   key: 'share',
        //   confirm: '确认进行绑定房间？'
        // }
      ]
    }
  },
  props: {},
  filters: {},
  created() {
  },
  methods: {

    /* onLoad() {
      Mock.Random.extend({
        roomType(date) {
          return this.pick(['单间', '一房一厅', '两房一厅', '三房一厅', '豪华套房'])
        },
        area() {
          return randomNum(50, 200)
        },
        amount() {
          return randomNum(500, 2000)
        }
      })
      var data = Mock.mock({
        // 属性 list 的值是一个数组，其中含有 1 到 10 个元素
        'list|20': [{
          // 属性 id 是一个自增数，起始值为 1，每次增 1
          'id|+1': 1,
          'area': '@area',
          'amount': '@amount',
          'create_time': '@now',
          'status': '启用',
          'name': '@roomtype'
        }]
      })

      console.log('mock', data)

      this.setMockData(data)
    }
    */
  }
}
</script>

<style lang="scss">

</style>
